<?php
  class Doc_type extends ActiveRecord\Model {

      static function AddNewType($newType)
      {
          
          if (Doc_type::find_by_doc_type_desc($newType))
            return "Duplicate Key";
            
          $type = new Doc_type(Array('doc_type_desc'=>$newType));
          return $type->save();
      }
} // End Class Things_model

?>
